package net.lcheng.service;

import net.lcheng.model.UserShippingAddress;

import java.util.List;

/**
 * Created by zwr on 2016/6/29 0029.
 */
public interface UserShippingAddressService {
    /***
     * 通过用户id获取自己的收货地址
     * @param userId
     * @return
     */
    List<UserShippingAddress> getUserShippingAddressByUserUserId(String userId);

    /**
     * 根据userId获取地址
     * @param userId
     * @return
     */
    UserShippingAddress getAddressByUserId(String userId);

    /**
     *根据地址id获取地址信息
     * @param addressId
     * @return
     */
    UserShippingAddress getAddressByAddressId(String addressId);

    /***
     * 添加收货地址
     *  @param provinceCode
     * @param cityCode
     * @param userId
     * @param consigneeName
     * @param isDefault      @return
     * */
    int insert(String provinceName,String cityName,String districtName,String userId, String districtCode, String provinceCode, String cityCode, String consigneeName, String consigneePhone, String address, Integer isDefault,String zipCode);
    /***
     * 编辑收货地址信息
     * @param addressId
     * @param provinceName
     * @param cityName
     * @param districtName
     * @param districtCode
     * @param provinceCode
     * @param cityCode
     * @param consigneeName
     * @param consigneePhone
     * @param address
     * @param isDefault
     * @return
     */
    int edit(String addressId, String provinceName, String cityName, String districtName, String districtCode, String provinceCode, String cityCode, String consigneeName, String consigneePhone, String address, Integer isDefault,String zipCode);

    /***
     * 删除用户地址
     * @param addressId
     * @return
     */
    int deleteAddress(String addressId);


    /**
     * 获取默认收货地址（create by LV）
     * @param buyerUserId 买家UserId
     * @return
     */
    UserShippingAddress getShippingAddressByUserIdAndDefaultType(String buyerUserId);

    /**
     * 由主键查询收货地址(create by LV)
     * @param primaryKey
     * @return
     */
    UserShippingAddress getShippingAddressByPrimaryKey(String primaryKey);

    /**
     * 添加收货地址（create by LV）
     * @param address
     * @return
     */
    int insertShippingAddress(UserShippingAddress address);

    /**
     * 由主键更新收货地址
     * @param address
     * @return
     */
    int editShippingAddressByPrimaryKey(UserShippingAddress address);


    /***
     *
     * @param addressId
     * @param isDefault
     * @return
     */
    int updateIsDefault(String addressId, int isDefault);
}
